package com.hss.common.utils;

import android.content.Context;
import android.view.Gravity;
import android.widget.Toast;

public class ToastUtil {
	public static void showToast(Context mContext, String msg, boolean longOrShort){
		if (msg == null) return;
		Toast toast = Toast.makeText(mContext.getApplicationContext(), msg, longOrShort ? Toast.LENGTH_LONG :Toast.LENGTH_SHORT );
//		toast.setGravity(Gravity.CENTER, 0, 0);
		toast.show();

		mContext = null;
	}
	
	public static void showToast(Context context, int info, boolean longOrShort) {
		Toast.makeText(context.getApplicationContext(), info, longOrShort ? Toast.LENGTH_LONG :Toast.LENGTH_SHORT ).show();
		context = null;
	}

	/** 显示自定义Toast提示2(来自String) **/
	public static void showCustomToast(Context context ,String text ,int gravity) {

//		View toastRoot = LayoutInflater.from(context).inflate(
//				R.layout.common_toast, null);
//		((HandyTextView) toastRoot.findViewById(R.id.toast_text)).setText(text);
//		mToast = new Toast(context);
//		//toast.setGravity(Gravity.CENTER, 0, 0);
//		mToast.setGravity(gravity, 0, 0);
//		mToast.setDuration(Toast.LENGTH_SHORT);
//		mToast.setView(toastRoot);
//		mToast.show();
	}
}
